package com.xishu.client.sms;

import com.xishu.client.HttpClientUtil;

import java.util.HashMap;
import java.util.Map;

public class YunPianClient implements IsmsClient {
    private static YunPianClient instance = new YunPianClient();

    private static final String KEY = "2b4d1cfbc43846e42828e7287acaee4f";

    private YunPianClient() {
    }

    public static YunPianClient getInstance() {
        return instance;
    }


    @Override
    public void send(String areaCode, String phone, String content) throws Exception {
        Map params = new HashMap<String, String>(); //请求参数集合
        params.put("apikey", KEY);
        params.put("text", content);
        params.put("mobile", phone);
        HttpClientUtil.post("https://sms.yunpian.com/v2/sms/single_send.json", new HashMap<>(), params);
    }
}
